#ifndef WWFRONTEND_CMD_PARSER_H
#define WWFRONTEND_CMD_PARSER_H

#include <boost/noncopyable.hpp>
#include <map>
#include <string>
#include <vector>

typedef int (*CmdFuncPtr)(const std::string& args);
class CmdParser : public boost::noncopyable
{
public:
    CmdParser();
    ~CmdParser();
    int ReadCmd();
    void ExecuteCmd();
    bool RegisterCmd(const std::string& cmdid, CmdFuncPtr cmdfunc);
    void BuildAllCmds();
private:
    std::map<std::string, CmdFuncPtr>  m_allCmds;
    std::string   m_current_cmdid;
    std::string  m_current_cmdargs;
};

#endif
